import 'dart:convert';

import 'package:google_maps_flutter/google_maps_flutter.dart';


/// 应对数据的不确定性导致参数各类的数据都有，每个参数都做安全处理比较冗余
/// so:对用到的参数进行json序列化就行


class AreaInfoM {
  AreaInfoM({
    required this.areaCode,
    required this.brandCode,
    required this.judgementAreaPoints,
    required this.interruptAreaPoints,
    required this.operateAreaPoints,
    required this.judgementRectanglePoints,
    required this.interruptRectanglePoints,
    required this.operateRectanglePoints,
    required this.isOpen,
    required this.isNeedHelmet,
    required this.isNeedDeposit,
    required this.isNeed90degreeParking,
    required this.isForceHelmet,
    required this.siteOffsetAngle,
    required this.rechargeRules,
    required this.judgementCenterPoints,
    required this.interruptCenterPoints,
    required this.operateCenterPoints,
    required this.chargeType,
    required this.startPrice,
    required this.startMin,
    required this.everyMin,
    required this.everyPrice,
    required this.deposit,
    required this.maxPrice,
    required this.freeTime,
    required this.trafficFare,
    required this.serviceOutwardFee,
    required this.nostopOutwardFee,
    required this.helmetFee,
    this.helmetFeeInfo,
    required this.isOpenPreDeposit,
    required this.preDeposit,
    required this.forbiddenSoc,
    required this.isNeedFaceAuth,
    required this.isNeedFaceRiding,
    required this.isFirstOrderFree,
    required this.freeRidingTimesEveryDay,
    required this.isFirstOrderFreeDispach,
    required this.defaultReturnBikeRadius,
    required this.isJudgeUserCoordinates,
    required this.judgeUserCoordinatesRadius,
    required this.isNeedJudgeParkingArea,
    required this.isOpenWechat,
    required this.isOpenAlipay,
    // this.operationConfig,
    required this.isRechargeBalance,
    required this.minBalance,
    required this.isBindingInsurance,
    required this.isJudgementAreaPower,
    // required this.areaList,
    required this.isBillingDuration,
    required this.priceTime,
    required this.weekPriceTime,
    required this.temporaryDeviceLockTime,
    required this.autoDeviceLockTime,
    required this.isOpenPrepayEndOrder,
    required this.isOpenAutoPay,
    required this.stopOperationContent,
    required this.stopAreaTime,
    required this.noCoordinatesOrderAutoLockTime,
    required this.faceTimeConf,
    required this.skipFaceId,
    required this.skipFaceIdTime,
    required this.skipFaceIdNum,
    required this.isOpenDepositFreeCards,
    required this.payType,
    required this.isOpenSmartHelmet,
    required this.autoReturnVehPlan,
    required this.isOpenAutoLock,
    required this.isOpenAreaRecharge,
    required this.preTemporaryDeviceLockTime,
    required this.preAutoDeviceLockTime,
    required this.isLimitRideForViolation,
    required this.isShowMapNearbyVehicles,
    required this.freeViolationLimitNum,
    required this.isShowMapNearbyStation,
    required this.firstFreeOrderAmount,
    required this.isBorrowBikeLocationLimit,
    // this.dispatchConfig,
    // this.electricityConfig,
    required this.borrowBikeDistinctLimit,
    required this.isOpenPreVid,
    required this.isHelmetPosCheck,
    required this.operationContentShowTime,
    required this.isHelmetReturnCheck,
    required this.isRfidReturnCheck,
    required this.isOrderAppeal,
    required this.isOpenRentCar,
    required this.rentCarPreDeposit,
    required this.homeReplacementPrice,
    required this.carRentalPackage,
    required this.enableRentalOvertime,
    required this.rentalBillingCycle,
    required this.rentalCyclePrice,
    // required this.voiceOpen,
    // required this.helmetFeeInfo,
    required this.isHelmetToStart,
    required this.temLockCheckArea,
    required this.freeTimeSec,
    required this.useFreeTimeSec,
    this.configs,
    required this.preOrderAutoEnd,
    this.modelBillingList,
  });

  AreaInfoM.fromJson(dynamic json) {
    areaCode = json['area_code'];
    brandCode = json['brand_code'];
    judgementAreaPoints = json['judgement_area_points'];
    interruptAreaPoints = json['interrupt_area_points'];
    if(json['operate_area_points'] != null && json['operate_area_points'].toString().isNotEmpty){
      List<dynamic> mList = jsonDecode(json['operate_area_points']);
      List<LatLng> mCacheList = [];
      for(var item in mList){
        if(item is List && item.isNotEmpty){
          mCacheList.add(LatLng(item[1], item[0]));
        }
      }
      operateAreaPoints = mCacheList;
    }else{
      operateAreaPoints = [];
    }
    judgementRectanglePoints = json['judgement_rectangle_points'];
    interruptRectanglePoints = json['interrupt_rectangle_points'];
    operateRectanglePoints = json['operate_rectangle_points'];
    isOpen = json['is_open'];
    isNeedHelmet = json['is_need_helmet'];
    isNeedDeposit = json['is_need_deposit'];
    isNeed90degreeParking = json['is_need_90degree_parking'];
    isForceHelmet = json['is_force_helmet'];
    siteOffsetAngle = json['site_offset_angle'];
    rechargeRules = json['recharge_rules'];
    judgementCenterPoints = json['judgement_center_points'];
    interruptCenterPoints = json['interrupt_center_points'];
    operateCenterPoints = json['operate_center_points'];
    chargeType = json['charge_type'];
    startPrice = json['start_price'];
    startMin = json['start_min'];
    everyMin = json['every_min'];
    everyPrice = json['every_price'];
    deposit = json['deposit'];
    maxPrice = json['max_price'];
    freeTime = json['free_time'];
    trafficFare = json['traffic_fare'];
    serviceOutwardFee = json['service_outward_fee'];
    nostopOutwardFee = json['nostop_outward_fee'];
    helmetFee = json['helmet_fee'];
    helmetFeeInfo = json['helmet_fee_info'] != null
        ? HelmetFreeInfo.fromJson(json['helmet_fee_info'])
        : null;
    isOpenPreDeposit = json['is_open_pre_deposit'];
    preDeposit = json['pre_deposit'];
    forbiddenSoc = json['forbidden_soc'];
    isNeedFaceAuth = json['is_need_face_auth'];
    isNeedFaceRiding = json['is_need_face_riding'];
    isFirstOrderFree = json['is_first_order_free'];
    freeRidingTimesEveryDay = json['free_riding_times_every_day'] ??0;
    isFirstOrderFreeDispach = json['is_first_order_free_dispach'];
    defaultReturnBikeRadius = json['default_return_bike_radius'];
    isJudgeUserCoordinates = json['is_judge_user_coordinates'];
    judgeUserCoordinatesRadius = json['judge_user_coordinates_radius'];
    isNeedJudgeParkingArea = json['is_need_judge_parking_area'];
    isOpenWechat = json['is_open_wechat'];
    isOpenAlipay = json['is_open_alipay'];
    // operationConfig = json['operation_config'] != null
    //     ? OperationConfig.fromJson(json['operation_config'])
    //     : null;
    isRechargeBalance = json['is_recharge_balance'];
    minBalance = json['min_balance'];
    isBindingInsurance = json['is_binding_insurance'];
    isJudgementAreaPower = json['is_judgement_area_power'];
    // areaList = json['area_list'];
    isBillingDuration = json['is_billing_duration'];
    priceTime = json['price_time'];
    weekPriceTime = json['week_price_time'];
    temporaryDeviceLockTime = json['temporary_device_lock_time'];
    autoDeviceLockTime = json['auto_device_lock_time'];
    isOpenPrepayEndOrder = json['is_open_prepay_end_order'];
    isOpenAutoPay = json['is_open_auto_pay'];
    stopOperationContent = json['stop_operation_content'];
    stopAreaTime = json['stop_area_time'] != null
        ? json['stop_area_time'].cast<String>()
        : [];
    noCoordinatesOrderAutoLockTime =
        json['no_coordinates_order_auto_lock_time'];
    faceTimeConf = json['face_time_conf'];
    skipFaceId = json['skip_face_id'];
    skipFaceIdTime = json['skip_face_id_time'];
    skipFaceIdNum = json['skip_face_id_num'];
    isOpenDepositFreeCards = json['is_open_deposit_free_cards'];
    payType = json['pay_type'];
    isOpenSmartHelmet = json['is_open_smart_helmet'];
    autoReturnVehPlan = json['auto_return_veh_plan'];
    isOpenAutoLock = json['is_open_auto_lock'];
    isOpenAreaRecharge = json['is_open_area_recharge'];
    preTemporaryDeviceLockTime = json['pre_temporary_device_lock_time'];
    preAutoDeviceLockTime = json['pre_auto_device_lock_time'];
    isLimitRideForViolation = json['is_limit_ride_for_violation'];
    isShowMapNearbyVehicles = json['is_show_map_nearby_vehicles'];
    freeViolationLimitNum = json['free_violation_limit_num'];
    isShowMapNearbyStation = json['is_show_map_nearby_station'];
    firstFreeOrderAmount = json['first_free_order_amount'];
    isBorrowBikeLocationLimit = json['is_borrow_bike_location_limit'];
    // dispatchConfig = json['dispatch_config'] != null
    //     ? DispatchConfig.fromJson(json['dispatch_config'])
    //     : null;
    // electricityConfig = json['electricity_config'] != null
    //     ? ElectricityConfig.fromJson(json['electricity_config'])
    //     : null;
    borrowBikeDistinctLimit = json['borrow_bike_distinct_limit'];
    isOpenPreVid = json['is_open_pre_vid'];
    isHelmetPosCheck = json['is_helmet_pos_check'];
    operationContentShowTime = json['operation_content_show_time'] != null
        ? json['operation_content_show_time'].cast<String>()
        : [];
    isHelmetReturnCheck = json['is_helmet_return_check'];
    isRfidReturnCheck = json['is_rfid_return_check'];
    isOrderAppeal = json['is_order_appeal'];
    isOpenRentCar = json['is_open_rent_car'];
    rentCarPreDeposit = json['rent_car_pre_deposit'];
    homeReplacementPrice = json['home_replacement_price'];
    carRentalPackage = json['car_rental_package'];
    enableRentalOvertime = json['enable_rental_overtime'];
    rentalBillingCycle = json['rental_billing_cycle'];
    rentalCyclePrice = json['rental_cycle_price'];
    // voiceOpen = json['voice_open'];
    // helmetFeeInfo = json['helmet_fee_info'];
    isHelmetToStart = json['is_helmet_to_start'];
    temLockCheckArea = json['tem_lock_check_area'];
    freeTimeSec = json['free_time_sec'];
    useFreeTimeSec = json['use_free_time_sec'];
    configs =
        json['configs'] != null ? Configs.fromJson(json['configs']) : null;
    preOrderAutoEnd = json['pre_order_auto_end'];
    modelBillingList = [];
    if (json['model_billing_list'] != null) {
      json['model_billing_list'].forEach((v) {
        modelBillingList!.add(ModelBillingList.fromJson(v));
      });
    }
  }

  late String areaCode;
  late String brandCode;
  late String judgementAreaPoints;
  late String interruptAreaPoints;
  late List<LatLng> operateAreaPoints;
  late String judgementRectanglePoints;
  late String interruptRectanglePoints;
  late String operateRectanglePoints;
  late num isOpen;
  late num isNeedHelmet;
  late num isNeedDeposit;
  late num isNeed90degreeParking;
  late num isForceHelmet;
  late num siteOffsetAngle;
  late String rechargeRules;
  late String judgementCenterPoints;
  late String interruptCenterPoints;
  late String operateCenterPoints;
  late num chargeType;
  late num startPrice;
  late num startMin;
  late num everyMin;
  late num everyPrice;
  late num deposit;
  late num maxPrice;
  late num freeTime;
  late num trafficFare;
  late num serviceOutwardFee;
  late num nostopOutwardFee;
  late num helmetFee;
  HelmetFreeInfo? helmetFeeInfo;
  late num isOpenPreDeposit;
  late num preDeposit;
  late num forbiddenSoc;
  late num isNeedFaceAuth;
  late num isNeedFaceRiding;
  late num isFirstOrderFree;
  late num freeRidingTimesEveryDay;
  late num isFirstOrderFreeDispach;
  late num defaultReturnBikeRadius;
  late num isJudgeUserCoordinates;
  late num judgeUserCoordinatesRadius;
  late num isNeedJudgeParkingArea;
  late num isOpenWechat;
  late num isOpenAlipay;
  // OperationConfig? operationConfig;
  late num isRechargeBalance;
  late num minBalance;
  late num isBindingInsurance;
  late num isJudgementAreaPower;

  // late dynamic areaList;
  late num isBillingDuration;
  String? priceTime;
  String? weekPriceTime;
  late num temporaryDeviceLockTime;
  late num autoDeviceLockTime;
  late num isOpenPrepayEndOrder;
  late num isOpenAutoPay;
  late String stopOperationContent;
  late List<String> stopAreaTime;
  late num noCoordinatesOrderAutoLockTime;
  late num faceTimeConf;
  late num skipFaceId;
  late num skipFaceIdTime;
  late num skipFaceIdNum;
  late num isOpenDepositFreeCards;
  late num payType;
  late num isOpenSmartHelmet;
  late num autoReturnVehPlan;
  late num isOpenAutoLock;
  late num isOpenAreaRecharge;
  late num preTemporaryDeviceLockTime;
  late num preAutoDeviceLockTime;
  late num isLimitRideForViolation;
  late num isShowMapNearbyVehicles;
  late num freeViolationLimitNum;
  late num isShowMapNearbyStation;
  late num firstFreeOrderAmount;
  late num isBorrowBikeLocationLimit;
  // DispatchConfig? dispatchConfig;
  // ElectricityConfig? electricityConfig;
  late num borrowBikeDistinctLimit;
  late num isOpenPreVid;
  late num isHelmetPosCheck;
  late List<String> operationContentShowTime;
  late num isHelmetReturnCheck;
  late num isRfidReturnCheck;
  late num isOrderAppeal;
  late num isOpenRentCar;
  late num rentCarPreDeposit;
  late num homeReplacementPrice;
  late String carRentalPackage;
  late num enableRentalOvertime;
  late num rentalBillingCycle;
  late num rentalCyclePrice;

  // late dynamic voiceOpen;
  // late dynamic helmetFeeInfo;
  late num isHelmetToStart;
  late num temLockCheckArea;
  late num freeTimeSec;
  late num useFreeTimeSec;
  Configs? configs;
  late num preOrderAutoEnd;
  List<ModelBillingList>? modelBillingList;

  AreaInfoM copyWith({
    String? areaCode,
    String? brandCode,
    String? judgementAreaPoints,
    String? interruptAreaPoints,
    List<LatLng>? operateAreaPoints,
    String? judgementRectanglePoints,
    String? interruptRectanglePoints,
    String? operateRectanglePoints,
    num? isOpen,
    num? isNeedHelmet,
    num? isNeedDeposit,
    num? isNeed90degreeParking,
    num? isForceHelmet,
    num? siteOffsetAngle,
    String? rechargeRules,
    String? judgementCenterPoints,
    String? interruptCenterPoints,
    String? operateCenterPoints,
    num? chargeType,
    num? startPrice,
    num? startMin,
    num? everyMin,
    num? everyPrice,
    num? deposit,
    num? maxPrice,
    num? freeTime,
    num? trafficFare,
    num? serviceOutwardFee,
    num? nostopOutwardFee,
    num? helmetFee,
    HelmetFreeInfo? helmetFeeInfo,
    num? isOpenPreDeposit,
    num? preDeposit,
    num? forbiddenSoc,
    num? isNeedFaceAuth,
    num? isNeedFaceRiding,
    num? isFirstOrderFree,
    num? freeRidingTimesEveryDay,
    num? isFirstOrderFreeDispach,
    num? defaultReturnBikeRadius,
    num? isJudgeUserCoordinates,
    num? judgeUserCoordinatesRadius,
    num? isNeedJudgeParkingArea,
    num? isOpenWechat,
    num? isOpenAlipay,
    // OperationConfig? operationConfig,
    num? isRechargeBalance,
    num? minBalance,
    num? isBindingInsurance,
    num? isJudgementAreaPower,
    // dynamic? areaList,
    num? isBillingDuration,
    String? priceTime,
    String? weekPriceTime,
    num? temporaryDeviceLockTime,
    num? autoDeviceLockTime,
    num? isOpenPrepayEndOrder,
    num? isOpenAutoPay,
    String? stopOperationContent,
    List<String>? stopAreaTime,
    num? noCoordinatesOrderAutoLockTime,
    num? faceTimeConf,
    num? skipFaceId,
    num? skipFaceIdTime,
    num? skipFaceIdNum,
    num? isOpenDepositFreeCards,
    num? payType,
    num? isOpenSmartHelmet,
    num? autoReturnVehPlan,
    num? isOpenAutoLock,
    num? isOpenAreaRecharge,
    num? preTemporaryDeviceLockTime,
    num? preAutoDeviceLockTime,
    num? isLimitRideForViolation,
    num? isShowMapNearbyVehicles,
    num? freeViolationLimitNum,
    num? isShowMapNearbyStation,
    num? firstFreeOrderAmount,
    num? isBorrowBikeLocationLimit,
    // DispatchConfig? dispatchConfig,
    // ElectricityConfig? electricityConfig,
    num? borrowBikeDistinctLimit,
    num? isOpenPreVid,
    num? isHelmetPosCheck,
    List<String>? operationContentShowTime,
    num? isHelmetReturnCheck,
    num? isRfidReturnCheck,
    num? isOrderAppeal,
    num? isOpenRentCar,
    num? rentCarPreDeposit,
    num? homeReplacementPrice,
    String? carRentalPackage,
    num? enableRentalOvertime,
    num? rentalBillingCycle,
    num? rentalCyclePrice,
    // dynamic? voiceOpen,
    // dynamic? helmetFeeInfo,
    num? isHelmetToStart,
    num? temLockCheckArea,
    num? freeTimeSec,
    num? useFreeTimeSec,
    Configs? configs,
    num? preOrderAutoEnd,
    List<ModelBillingList>? modelBillingList,
  }) =>
      AreaInfoM(
        areaCode: areaCode ?? this.areaCode,
        brandCode: brandCode ?? this.brandCode,
        judgementAreaPoints: judgementAreaPoints ?? this.judgementAreaPoints,
        interruptAreaPoints: interruptAreaPoints ?? this.interruptAreaPoints,
        operateAreaPoints: operateAreaPoints ?? this.operateAreaPoints,
        judgementRectanglePoints:
            judgementRectanglePoints ?? this.judgementRectanglePoints,
        interruptRectanglePoints:
            interruptRectanglePoints ?? this.interruptRectanglePoints,
        operateRectanglePoints:
            operateRectanglePoints ?? this.operateRectanglePoints,
        isOpen: isOpen ?? this.isOpen,
        isNeedHelmet: isNeedHelmet ?? this.isNeedHelmet,
        isNeedDeposit: isNeedDeposit ?? this.isNeedDeposit,
        isNeed90degreeParking:
            isNeed90degreeParking ?? this.isNeed90degreeParking,
        isForceHelmet: isForceHelmet ?? this.isForceHelmet,
        siteOffsetAngle: siteOffsetAngle ?? this.siteOffsetAngle,
        rechargeRules: rechargeRules ?? this.rechargeRules,
        judgementCenterPoints:
            judgementCenterPoints ?? this.judgementCenterPoints,
        interruptCenterPoints:
            interruptCenterPoints ?? this.interruptCenterPoints,
        operateCenterPoints: operateCenterPoints ?? this.operateCenterPoints,
        chargeType: chargeType ?? this.chargeType,
        startPrice: startPrice ?? this.startPrice,
        startMin: startMin ?? this.startMin,
        everyMin: everyMin ?? this.everyMin,
        everyPrice: everyPrice ?? this.everyPrice,
        deposit: deposit ?? this.deposit,
        maxPrice: maxPrice ?? this.maxPrice,
        freeTime: freeTime ?? this.freeTime,
        trafficFare: trafficFare ?? this.trafficFare,
        serviceOutwardFee: serviceOutwardFee ?? this.serviceOutwardFee,
        nostopOutwardFee: nostopOutwardFee ?? this.nostopOutwardFee,
        helmetFee: helmetFee ?? this.helmetFee,
        helmetFeeInfo: helmetFeeInfo ?? this.helmetFeeInfo,
        isOpenPreDeposit: isOpenPreDeposit ?? this.isOpenPreDeposit,
        preDeposit: preDeposit ?? this.preDeposit,
        forbiddenSoc: forbiddenSoc ?? this.forbiddenSoc,
        isNeedFaceAuth: isNeedFaceAuth ?? this.isNeedFaceAuth,
        isNeedFaceRiding: isNeedFaceRiding ?? this.isNeedFaceRiding,
        isFirstOrderFree: isFirstOrderFree ?? this.isFirstOrderFree,
        freeRidingTimesEveryDay:
            freeRidingTimesEveryDay ?? this.freeRidingTimesEveryDay,
        isFirstOrderFreeDispach:
            isFirstOrderFreeDispach ?? this.isFirstOrderFreeDispach,
        defaultReturnBikeRadius:
            defaultReturnBikeRadius ?? this.defaultReturnBikeRadius,
        isJudgeUserCoordinates:
            isJudgeUserCoordinates ?? this.isJudgeUserCoordinates,
        judgeUserCoordinatesRadius:
            judgeUserCoordinatesRadius ?? this.judgeUserCoordinatesRadius,
        isNeedJudgeParkingArea:
            isNeedJudgeParkingArea ?? this.isNeedJudgeParkingArea,
        isOpenWechat: isOpenWechat ?? this.isOpenWechat,
        isOpenAlipay: isOpenAlipay ?? this.isOpenAlipay,
        // operationConfig: operationConfig ?? this.operationConfig,
        isRechargeBalance: isRechargeBalance ?? this.isRechargeBalance,
        minBalance: minBalance ?? this.minBalance,
        isBindingInsurance: isBindingInsurance ?? this.isBindingInsurance,
        isJudgementAreaPower: isJudgementAreaPower ?? this.isJudgementAreaPower,
        // areaList: areaList ?? this.areaList,
        isBillingDuration: isBillingDuration ?? this.isBillingDuration,
        priceTime: priceTime ?? this.priceTime,
        weekPriceTime: weekPriceTime ?? this.weekPriceTime,
        temporaryDeviceLockTime:
            temporaryDeviceLockTime ?? this.temporaryDeviceLockTime,
        autoDeviceLockTime: autoDeviceLockTime ?? this.autoDeviceLockTime,
        isOpenPrepayEndOrder: isOpenPrepayEndOrder ?? this.isOpenPrepayEndOrder,
        isOpenAutoPay: isOpenAutoPay ?? this.isOpenAutoPay,
        stopOperationContent: stopOperationContent ?? this.stopOperationContent,
        stopAreaTime: stopAreaTime ?? this.stopAreaTime,
        noCoordinatesOrderAutoLockTime: noCoordinatesOrderAutoLockTime ??
            this.noCoordinatesOrderAutoLockTime,
        faceTimeConf: faceTimeConf ?? this.faceTimeConf,
        skipFaceId: skipFaceId ?? this.skipFaceId,
        skipFaceIdTime: skipFaceIdTime ?? this.skipFaceIdTime,
        skipFaceIdNum: skipFaceIdNum ?? this.skipFaceIdNum,
        isOpenDepositFreeCards:
            isOpenDepositFreeCards ?? this.isOpenDepositFreeCards,
        payType: payType ?? this.payType,
        isOpenSmartHelmet: isOpenSmartHelmet ?? this.isOpenSmartHelmet,
        autoReturnVehPlan: autoReturnVehPlan ?? this.autoReturnVehPlan,
        isOpenAutoLock: isOpenAutoLock ?? this.isOpenAutoLock,
        isOpenAreaRecharge: isOpenAreaRecharge ?? this.isOpenAreaRecharge,
        preTemporaryDeviceLockTime:
            preTemporaryDeviceLockTime ?? this.preTemporaryDeviceLockTime,
        preAutoDeviceLockTime:
            preAutoDeviceLockTime ?? this.preAutoDeviceLockTime,
        isLimitRideForViolation:
            isLimitRideForViolation ?? this.isLimitRideForViolation,
        isShowMapNearbyVehicles:
            isShowMapNearbyVehicles ?? this.isShowMapNearbyVehicles,
        freeViolationLimitNum:
            freeViolationLimitNum ?? this.freeViolationLimitNum,
        isShowMapNearbyStation:
            isShowMapNearbyStation ?? this.isShowMapNearbyStation,
        firstFreeOrderAmount: firstFreeOrderAmount ?? this.firstFreeOrderAmount,
        isBorrowBikeLocationLimit:
            isBorrowBikeLocationLimit ?? this.isBorrowBikeLocationLimit,
        // dispatchConfig: dispatchConfig ?? this.dispatchConfig,
        // electricityConfig: electricityConfig ?? this.electricityConfig,
        borrowBikeDistinctLimit:
            borrowBikeDistinctLimit ?? this.borrowBikeDistinctLimit,
        isOpenPreVid: isOpenPreVid ?? this.isOpenPreVid,
        isHelmetPosCheck: isHelmetPosCheck ?? this.isHelmetPosCheck,
        operationContentShowTime:
            operationContentShowTime ?? this.operationContentShowTime,
        isHelmetReturnCheck: isHelmetReturnCheck ?? this.isHelmetReturnCheck,
        isRfidReturnCheck: isRfidReturnCheck ?? this.isRfidReturnCheck,
        isOrderAppeal: isOrderAppeal ?? this.isOrderAppeal,
        isOpenRentCar: isOpenRentCar ?? this.isOpenRentCar,
        rentCarPreDeposit: rentCarPreDeposit ?? this.rentCarPreDeposit,
        homeReplacementPrice: homeReplacementPrice ?? this.homeReplacementPrice,
        carRentalPackage: carRentalPackage ?? this.carRentalPackage,
        enableRentalOvertime: enableRentalOvertime ?? this.enableRentalOvertime,
        rentalBillingCycle: rentalBillingCycle ?? this.rentalBillingCycle,
        rentalCyclePrice: rentalCyclePrice ?? this.rentalCyclePrice,
        // voiceOpen: voiceOpen ?? this.voiceOpen,
        // helmetFeeInfo: helmetFeeInfo ?? this.helmetFeeInfo,
        isHelmetToStart: isHelmetToStart ?? this.isHelmetToStart,
        temLockCheckArea: temLockCheckArea ?? this.temLockCheckArea,
        freeTimeSec: freeTimeSec ?? this.freeTimeSec,
        useFreeTimeSec: useFreeTimeSec ?? this.useFreeTimeSec,
        configs: configs ?? this.configs,
        preOrderAutoEnd: preOrderAutoEnd ?? this.preOrderAutoEnd,
        modelBillingList: modelBillingList ?? this.modelBillingList,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['area_code'] = areaCode;
    map['brand_code'] = brandCode;
    map['judgement_area_points'] = judgementAreaPoints;
    map['interrupt_area_points'] = interruptAreaPoints;
    map['operate_area_points'] = operateAreaPoints;
    map['judgement_rectangle_points'] = judgementRectanglePoints;
    map['interrupt_rectangle_points'] = interruptRectanglePoints;
    map['operate_rectangle_points'] = operateRectanglePoints;
    map['is_open'] = isOpen;
    map['is_need_helmet'] = isNeedHelmet;
    map['is_need_deposit'] = isNeedDeposit;
    map['is_need_90degree_parking'] = isNeed90degreeParking;
    map['is_force_helmet'] = isForceHelmet;
    map['site_offset_angle'] = siteOffsetAngle;
    map['recharge_rules'] = rechargeRules;
    map['judgement_center_points'] = judgementCenterPoints;
    map['interrupt_center_points'] = interruptCenterPoints;
    map['operate_center_points'] = operateCenterPoints;
    map['charge_type'] = chargeType;
    map['start_price'] = startPrice;
    map['start_min'] = startMin;
    map['every_min'] = everyMin;
    map['every_price'] = everyPrice;
    map['deposit'] = deposit;
    map['max_price'] = maxPrice;
    map['free_time'] = freeTime;
    map['traffic_fare'] = trafficFare;
    map['service_outward_fee'] = serviceOutwardFee;
    map['nostop_outward_fee'] = nostopOutwardFee;
    map['helmet_fee'] = helmetFee;
    if (helmetFeeInfo != null) {
      map['helmet_fee_info'] = helmetFeeInfo!.toJson();
    }
    map['is_open_pre_deposit'] = isOpenPreDeposit;
    map['pre_deposit'] = preDeposit;
    map['forbidden_soc'] = forbiddenSoc;
    map['is_need_face_auth'] = isNeedFaceAuth;
    map['is_need_face_riding'] = isNeedFaceRiding;
    map['is_first_order_free'] = isFirstOrderFree;
    map['free_riding_times_every_day'] = freeRidingTimesEveryDay;
    map['is_first_order_free_dispach'] = isFirstOrderFreeDispach;
    map['default_return_bike_radius'] = defaultReturnBikeRadius;
    map['is_judge_user_coordinates'] = isJudgeUserCoordinates;
    map['judge_user_coordinates_radius'] = judgeUserCoordinatesRadius;
    map['is_need_judge_parking_area'] = isNeedJudgeParkingArea;
    map['is_open_wechat'] = isOpenWechat;
    map['is_open_alipay'] = isOpenAlipay;
    // if (operationConfig != null) {
    //   map['operation_config'] = operationConfig!.toJson();
    // }
    map['is_recharge_balance'] = isRechargeBalance;
    map['min_balance'] = minBalance;
    map['is_binding_insurance'] = isBindingInsurance;
    map['is_judgement_area_power'] = isJudgementAreaPower;
    // map['area_list'] = areaList;
    map['is_billing_duration'] = isBillingDuration;
    map['price_time'] = priceTime;
    map['week_price_time'] = weekPriceTime;
    map['temporary_device_lock_time'] = temporaryDeviceLockTime;
    map['auto_device_lock_time'] = autoDeviceLockTime;
    map['is_open_prepay_end_order'] = isOpenPrepayEndOrder;
    map['is_open_auto_pay'] = isOpenAutoPay;
    map['stop_operation_content'] = stopOperationContent;
    map['stop_area_time'] = stopAreaTime;
    map['no_coordinates_order_auto_lock_time'] = noCoordinatesOrderAutoLockTime;
    map['face_time_conf'] = faceTimeConf;
    map['skip_face_id'] = skipFaceId;
    map['skip_face_id_time'] = skipFaceIdTime;
    map['skip_face_id_num'] = skipFaceIdNum;
    map['is_open_deposit_free_cards'] = isOpenDepositFreeCards;
    map['pay_type'] = payType;
    map['is_open_smart_helmet'] = isOpenSmartHelmet;
    map['auto_return_veh_plan'] = autoReturnVehPlan;
    map['is_open_auto_lock'] = isOpenAutoLock;
    map['is_open_area_recharge'] = isOpenAreaRecharge;
    map['pre_temporary_device_lock_time'] = preTemporaryDeviceLockTime;
    map['pre_auto_device_lock_time'] = preAutoDeviceLockTime;
    map['is_limit_ride_for_violation'] = isLimitRideForViolation;
    map['is_show_map_nearby_vehicles'] = isShowMapNearbyVehicles;
    map['free_violation_limit_num'] = freeViolationLimitNum;
    map['is_show_map_nearby_station'] = isShowMapNearbyStation;
    map['first_free_order_amount'] = firstFreeOrderAmount;
    map['is_borrow_bike_location_limit'] = isBorrowBikeLocationLimit;
    // if (dispatchConfig != null) {
      // map['dispatch_config'] = dispatchConfig!.toJson();
    // }
    // if (electricityConfig != null) {
    //   map['electricity_config'] = electricityConfig!.toJson();
    // }
    map['borrow_bike_distinct_limit'] = borrowBikeDistinctLimit;
    map['is_open_pre_vid'] = isOpenPreVid;
    map['is_helmet_pos_check'] = isHelmetPosCheck;
    map['operation_content_show_time'] = operationContentShowTime;
    map['is_helmet_return_check'] = isHelmetReturnCheck;
    map['is_rfid_return_check'] = isRfidReturnCheck;
    map['is_order_appeal'] = isOrderAppeal;
    map['is_open_rent_car'] = isOpenRentCar;
    map['rent_car_pre_deposit'] = rentCarPreDeposit;
    map['home_replacement_price'] = homeReplacementPrice;
    map['car_rental_package'] = carRentalPackage;
    map['enable_rental_overtime'] = enableRentalOvertime;
    map['rental_billing_cycle'] = rentalBillingCycle;
    map['rental_cycle_price'] = rentalCyclePrice;
    // map['voice_open'] = voiceOpen;
    map['is_helmet_to_start'] = isHelmetToStart;
    map['tem_lock_check_area'] = temLockCheckArea;
    map['free_time_sec'] = freeTimeSec;
    map['use_free_time_sec'] = useFreeTimeSec;
    if (configs != null) {
      map['configs'] = configs!.toJson();
    }
    map['pre_order_auto_end'] = preOrderAutoEnd;
    if (modelBillingList != null) {
      map['model_billing_list'] =
          modelBillingList!.map((v) => v.toJson()).toList();
    }
    return map;
  }
}

class ModelBillingList {
  ModelBillingList({
    required this.model,
    required this.billingType,
    required this.unitPrice,
    required this.fullPrice,
    required this.openFull,
    required this.img,
    required this.freeTime,
    required this.freeTimeSec,
    required this.startPrice,
    required this.startMin,
    required this.everyMin,
    required this.everyPrice,
    required this.serviceOutwardFee,
    required this.nostopOutwardFee,
    required this.isNeedHelmetFee,
    required this.isNeedDeposit,
    required this.helmetFee,
    required this.maxPrice,
    required this.trafficFare,
    required this.useFreeTimeSec,
  });

  ModelBillingList.fromJson(dynamic json) {
    model = json['model'];
    billingType = json['billing_type'];
    unitPrice = json['unit_price'];
    fullPrice = json['full_price'];
    openFull = json['open_full'];
    img = json['img'];
    freeTime = json['free_time'];
    freeTimeSec = json['free_time_sec'];
    startPrice = json['start_price'];
    startMin = json['start_min'];
    everyMin = json['every_min'];
    everyPrice = json['every_price'];
    serviceOutwardFee = json['service_outward_fee'];
    nostopOutwardFee = json['nostop_outward_fee'];
    isNeedHelmetFee = json['is_need_helmet_fee'];
    isNeedDeposit = json['is_need_deposit'];
    helmetFee = json['helmet_fee'];
    maxPrice = json['max_price'];
    trafficFare = json['traffic_fare'];
    useFreeTimeSec = json['use_free_time_sec'];
  }

  late String model;
  late num billingType;
  late num unitPrice;
  late num fullPrice;
  late num openFull;
  late String img;
  late num freeTime;
  late num freeTimeSec;
  late num startPrice;
  late num startMin;
  late num everyMin;
  late num everyPrice;
  late num serviceOutwardFee;
  late num nostopOutwardFee;
  late num isNeedHelmetFee;
  late num isNeedDeposit;
  late num helmetFee;
  late num maxPrice;
  late num trafficFare;
  late num useFreeTimeSec;

  ModelBillingList copyWith({
    String? model,
    num? billingType,
    num? unitPrice,
    num? fullPrice,
    num? openFull,
    String? img,
    num? freeTime,
    num? freeTimeSec,
    num? startPrice,
    num? startMin,
    num? everyMin,
    num? everyPrice,
    num? serviceOutwardFee,
    num? nostopOutwardFee,
    num? isNeedHelmetFee,
    num? isNeedDeposit,
    num? helmetFee,
    num? maxPrice,
    num? trafficFare,
    num? useFreeTimeSec,
  }) =>
      ModelBillingList(
        model: model ?? this.model,
        billingType: billingType ?? this.billingType,
        unitPrice: unitPrice ?? this.unitPrice,
        fullPrice: fullPrice ?? this.fullPrice,
        openFull: openFull ?? this.openFull,
        img: img ?? this.img,
        freeTime: freeTime ?? this.freeTime,
        freeTimeSec: freeTimeSec ?? this.freeTimeSec,
        startPrice: startPrice ?? this.startPrice,
        startMin: startMin ?? this.startMin,
        everyMin: everyMin ?? this.everyMin,
        everyPrice: everyPrice ?? this.everyPrice,
        serviceOutwardFee: serviceOutwardFee ?? this.serviceOutwardFee,
        nostopOutwardFee: nostopOutwardFee ?? this.nostopOutwardFee,
        isNeedHelmetFee: isNeedHelmetFee ?? this.isNeedHelmetFee,
        isNeedDeposit: isNeedDeposit ?? this.isNeedDeposit,
        helmetFee: helmetFee ?? this.helmetFee,
        maxPrice: maxPrice ?? this.maxPrice,
        trafficFare: trafficFare ?? this.trafficFare,
        useFreeTimeSec: useFreeTimeSec ?? this.useFreeTimeSec,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['model'] = model;
    map['billing_type'] = billingType;
    map['unit_price'] = unitPrice;
    map['full_price'] = fullPrice;
    map['open_full'] = openFull;
    map['img'] = img;
    map['free_time'] = freeTime;
    map['free_time_sec'] = freeTimeSec;
    map['start_price'] = startPrice;
    map['start_min'] = startMin;
    map['every_min'] = everyMin;
    map['every_price'] = everyPrice;
    map['service_outward_fee'] = serviceOutwardFee;
    map['nostop_outward_fee'] = nostopOutwardFee;
    map['is_need_helmet_fee'] = isNeedHelmetFee;
    map['is_need_deposit'] = isNeedDeposit;
    map['helmet_fee'] = helmetFee;
    map['max_price'] = maxPrice;
    map['traffic_fare'] = trafficFare;
    map['use_free_time_sec'] = useFreeTimeSec;
    return map;
  }
}

class Configs {
  Configs({
    required this.areaMonitorLockTime,
    required this.balanceRefund,
    required this.balanceRefundAutoPass,
    required this.balanceRefundSubGive,
    required this.canQuickOpenCar,
    required this.consumerService,
    required this.contactMobile,
    required this.disAreaLimit,
    required this.dispatchAutoLockTime,
    required this.dispatchNotAllowBorrow,
    required this.excludeFreeTime,
    required this.firstUseBalance,
    required this.forbiddenZoneNoBorrow,
    required this.forcePayAfterArea,
    required this.invoicesApply,
    required this.invoicesOrderTime,
    required this.isDispatchAutoLock,
    required this.isForceAiStationReturn,
    required this.isNeedFaceReturn,
    required this.isOpenInviteActivity,
    required this.isOpenPowerLimit,
    required this.isOutRangeBorrow,
    required this.isOutareaHelmet,
    required this.isRfidPowerOff,
    required this.isScanToUnlockDirectly,
    required this.isSetWirelessParking,
    required this.isShowMapBikePower,
    required this.isShowPolicy,
    required this.isSkip90park,
    required this.isSyncMileSoc,
    required this.isUnlockPageShowMap,
    required this.learnBeforeCycling,
    required this.lowPowerOffThreshold,
    required this.lowPowerOpenTimeLimit,
    required this.openPowerLimitTime,
    required this.openTime,
    required this.openType,
    required this.operateAreaRfidArray,
    required this.ordAppealImage,
    required this.ordAppealZeroAutoPass,
    required this.ordAppealZeroAutoPassTime,
    required this.outRangeBorrowTime,
    required this.payAfterArea,
    required this.pileConfig,
    required this.pileOutsideBorrow,
    required this.pileType,
    required this.powerAreaRfidArray,
    required this.prepayRidingcardTip,
    required this.rechargeThenPay,
    required this.returnPowerOff,
    required this.skip90parkCount,
    required this.skipParkType,
    required this.studyFreeTraffic,
    required this.studyFreeTrafficNum,
    required this.studyFreeTrafficType,
    required this.tpReturnHelmet,
    required this.userAuth,
    required this.vehicleShareProfit,
    required this.wearHelmetToAcc,
  });

  Configs.fromJson(dynamic json) {
    areaMonitorLockTime = json['area_monitor_lock_time']??'';
    balanceRefund = json['balance_refund']??'';
    balanceRefundAutoPass = json['balance_refund_auto_pass']??'';
    balanceRefundSubGive = json['balance_refund_sub_give']??'';
    canQuickOpenCar = json['can_quick_open_car']??'';
    consumerService = json['consumer_service']??'';
    contactMobile = json['contact_mobile']??'';
    disAreaLimit = json['dis_area_limit']??'';
    dispatchAutoLockTime = json['dispatch_auto_lock_time']??'';
    dispatchNotAllowBorrow = json['dispatch_not_allow_borrow']??'';
    excludeFreeTime = json['exclude_free_time']??'2'; // 默认值
    firstUseBalance = json['first_use_balance']??'';
    forbiddenZoneNoBorrow = json['forbidden_zone_no_borrow']??'';
    forcePayAfterArea = json['force_pay_after_area']??'';
    invoicesApply = json['invoices_apply']??'';
    invoicesOrderTime = json['invoices_order_time']??'';
    isDispatchAutoLock = json['is_dispatch_auto_lock']??'';
    isForceAiStationReturn = json['is_force_ai_station_return']??'';
    isNeedFaceReturn = json['is_need_face_return']??'';
    isOpenInviteActivity = json['is_open_invite_activity']??'';
    isOpenPowerLimit = json['is_open_power_limit']??'';
    isOutRangeBorrow = json['is_out_range_borrow']??'';
    isOutareaHelmet = json['is_outarea_helmet']??'';
    isRfidPowerOff = json['is_rfid_power_off']??'';
    isScanToUnlockDirectly = json['is_scan_to_unlock_directly']??'';
    isSetWirelessParking = json['is_set_wireless_parking']??'';
    isShowMapBikePower = json['is_show_map_bike_power']??'';
    isShowPolicy = json['is_show_policy']??'';
    isSkip90park = json['is_skip_90park']??'';
    isSyncMileSoc = json['is_sync_mile_soc']??'';
    isUnlockPageShowMap = json['is_unlock_page_show_map']??'';
    learnBeforeCycling = json['learn_before_cycling']??'';
    lowPowerOffThreshold = json['low_power_off_threshold']??'';
    lowPowerOpenTimeLimit = json['low_power_open_time_limit']??'';
    openPowerLimitTime = json['open_power_limit_time']??'';
    openTime = json['open_time']??'';
    openType = json['open_type']??'';
    operateAreaRfidArray = json['operate_area_rfid_array']??'';
    ordAppealImage = json['ord_appeal_image']??'';
    ordAppealZeroAutoPass = json['ord_appeal_zero_auto_pass']??'';
    ordAppealZeroAutoPassTime = json['ord_appeal_zero_auto_pass_time']??'';
    outRangeBorrowTime = json['out_range_borrow_time']??'';
    payAfterArea = json['pay_after_area']??'';
    pileConfig = json['pile_config']??'';
    pileOutsideBorrow = json['pile_outside_borrow']??'';
    pileType = json['pile_type']??'';
    powerAreaRfidArray = json['power_area_rfid_array']??'';
    prepayRidingcardTip = json['prepay_ridingcard_tip']??'';
    rechargeThenPay = json['recharge_then_pay']??'';
    returnPowerOff = json['return_power_off']??'';
    skip90parkCount = json['skip_90park_count']??'';
    skipParkType = json['skip_park_type']??'';
    studyFreeTraffic = json['study_free_traffic']??'';
    studyFreeTrafficNum = json['study_free_traffic_num']??'';
    studyFreeTrafficType = json['study_free_traffic_type']??'';
    tpReturnHelmet = json['tp_return_helmet']??'';
    userAuth = json['user_auth']??'';
    vehicleShareProfit = json['vehicle_share_profit']??'';
    wearHelmetToAcc = json['wear_helmet_to_acc']??'';
  }

  late String areaMonitorLockTime;
  late String balanceRefund;
  late String balanceRefundAutoPass;
  late String balanceRefundSubGive;
  late String canQuickOpenCar;
  late String consumerService;
  late String contactMobile;
  late String disAreaLimit;
  late String dispatchAutoLockTime;
  late String dispatchNotAllowBorrow;
  late String excludeFreeTime;
  late String firstUseBalance;
  late String forbiddenZoneNoBorrow;
  late String forcePayAfterArea;
  late String invoicesApply;
  late String invoicesOrderTime;
  late String isDispatchAutoLock;
  late String isForceAiStationReturn;
  late String isNeedFaceReturn;
  late String isOpenInviteActivity;
  late String isOpenPowerLimit;
  late String isOutRangeBorrow;
  late String isOutareaHelmet;
  late String isRfidPowerOff;
  late String isScanToUnlockDirectly;
  late String isSetWirelessParking;
  late String isShowMapBikePower;
  late String isShowPolicy;
  late String isSkip90park;
  late String isSyncMileSoc;
  late String isUnlockPageShowMap;
  late String learnBeforeCycling;
  late String lowPowerOffThreshold;
  late String lowPowerOpenTimeLimit;
  late String openPowerLimitTime;
  late String openTime;
  late String openType;
  late String operateAreaRfidArray;
  late String ordAppealImage;
  late String ordAppealZeroAutoPass;
  late String ordAppealZeroAutoPassTime;
  late String outRangeBorrowTime;
  late String payAfterArea;
  late String pileConfig;
  late String pileOutsideBorrow;
  late String pileType;
  late String powerAreaRfidArray;
  late String prepayRidingcardTip;
  late String rechargeThenPay;
  late String returnPowerOff;
  late String skip90parkCount;
  late String skipParkType;
  late String studyFreeTraffic;
  late String studyFreeTrafficNum;
  late String studyFreeTrafficType;
  late String tpReturnHelmet;
  late String userAuth;
  late String vehicleShareProfit;
  late String wearHelmetToAcc;

  Configs copyWith({
    String? areaMonitorLockTime,
    String? balanceRefund,
    String? balanceRefundAutoPass,
    String? balanceRefundSubGive,
    String? canQuickOpenCar,
    String? consumerService,
    String? contactMobile,
    String? disAreaLimit,
    String? dispatchAutoLockTime,
    String? dispatchNotAllowBorrow,
    String? excludeFreeTime,
    String? firstUseBalance,
    String? forbiddenZoneNoBorrow,
    String? forcePayAfterArea,
    String? invoicesApply,
    String? invoicesOrderTime,
    String? isDispatchAutoLock,
    String? isForceAiStationReturn,
    String? isNeedFaceReturn,
    String? isOpenInviteActivity,
    String? isOpenPowerLimit,
    String? isOutRangeBorrow,
    String? isOutareaHelmet,
    String? isRfidPowerOff,
    String? isScanToUnlockDirectly,
    String? isSetWirelessParking,
    String? isShowMapBikePower,
    String? isShowPolicy,
    String? isSkip90park,
    String? isSyncMileSoc,
    String? isUnlockPageShowMap,
    String? learnBeforeCycling,
    String? lowPowerOffThreshold,
    String? lowPowerOpenTimeLimit,
    String? openPowerLimitTime,
    String? openTime,
    String? openType,
    String? operateAreaRfidArray,
    String? ordAppealImage,
    String? ordAppealZeroAutoPass,
    String? ordAppealZeroAutoPassTime,
    String? outRangeBorrowTime,
    String? payAfterArea,
    String? pileConfig,
    String? pileOutsideBorrow,
    String? pileType,
    String? powerAreaRfidArray,
    String? prepayRidingcardTip,
    String? rechargeThenPay,
    String? returnPowerOff,
    String? skip90parkCount,
    String? skipParkType,
    String? studyFreeTraffic,
    String? studyFreeTrafficNum,
    String? studyFreeTrafficType,
    String? tpReturnHelmet,
    String? userAuth,
    String? vehicleShareProfit,
    String? wearHelmetToAcc,
  }) =>
      Configs(
        areaMonitorLockTime: areaMonitorLockTime ?? this.areaMonitorLockTime,
        balanceRefund: balanceRefund ?? this.balanceRefund,
        balanceRefundAutoPass:
            balanceRefundAutoPass ?? this.balanceRefundAutoPass,
        balanceRefundSubGive: balanceRefundSubGive ?? this.balanceRefundSubGive,
        canQuickOpenCar: canQuickOpenCar ?? this.canQuickOpenCar,
        consumerService: consumerService ?? this.consumerService,
        contactMobile: contactMobile ?? this.contactMobile,
        disAreaLimit: disAreaLimit ?? this.disAreaLimit,
        dispatchAutoLockTime: dispatchAutoLockTime ?? this.dispatchAutoLockTime,
        dispatchNotAllowBorrow:
            dispatchNotAllowBorrow ?? this.dispatchNotAllowBorrow,
        excludeFreeTime: excludeFreeTime ?? this.excludeFreeTime,
        firstUseBalance: firstUseBalance ?? this.firstUseBalance,
        forbiddenZoneNoBorrow:
            forbiddenZoneNoBorrow ?? this.forbiddenZoneNoBorrow,
        forcePayAfterArea: forcePayAfterArea ?? this.forcePayAfterArea,
        invoicesApply: invoicesApply ?? this.invoicesApply,
        invoicesOrderTime: invoicesOrderTime ?? this.invoicesOrderTime,
        isDispatchAutoLock: isDispatchAutoLock ?? this.isDispatchAutoLock,
        isForceAiStationReturn:
            isForceAiStationReturn ?? this.isForceAiStationReturn,
        isNeedFaceReturn: isNeedFaceReturn ?? this.isNeedFaceReturn,
        isOpenInviteActivity: isOpenInviteActivity ?? this.isOpenInviteActivity,
        isOpenPowerLimit: isOpenPowerLimit ?? this.isOpenPowerLimit,
        isOutRangeBorrow: isOutRangeBorrow ?? this.isOutRangeBorrow,
        isOutareaHelmet: isOutareaHelmet ?? this.isOutareaHelmet,
        isRfidPowerOff: isRfidPowerOff ?? this.isRfidPowerOff,
        isScanToUnlockDirectly:
            isScanToUnlockDirectly ?? this.isScanToUnlockDirectly,
        isSetWirelessParking: isSetWirelessParking ?? this.isSetWirelessParking,
        isShowMapBikePower: isShowMapBikePower ?? this.isShowMapBikePower,
        isShowPolicy: isShowPolicy ?? this.isShowPolicy,
        isSkip90park: isSkip90park ?? this.isSkip90park,
        isSyncMileSoc: isSyncMileSoc ?? this.isSyncMileSoc,
        isUnlockPageShowMap: isUnlockPageShowMap ?? this.isUnlockPageShowMap,
        learnBeforeCycling: learnBeforeCycling ?? this.learnBeforeCycling,
        lowPowerOffThreshold: lowPowerOffThreshold ?? this.lowPowerOffThreshold,
        lowPowerOpenTimeLimit:
            lowPowerOpenTimeLimit ?? this.lowPowerOpenTimeLimit,
        openPowerLimitTime: openPowerLimitTime ?? this.openPowerLimitTime,
        openTime: openTime ?? this.openTime,
        openType: openType ?? this.openType,
        operateAreaRfidArray: operateAreaRfidArray ?? this.operateAreaRfidArray,
        ordAppealImage: ordAppealImage ?? this.ordAppealImage,
        ordAppealZeroAutoPass:
            ordAppealZeroAutoPass ?? this.ordAppealZeroAutoPass,
        ordAppealZeroAutoPassTime:
            ordAppealZeroAutoPassTime ?? this.ordAppealZeroAutoPassTime,
        outRangeBorrowTime: outRangeBorrowTime ?? this.outRangeBorrowTime,
        payAfterArea: payAfterArea ?? this.payAfterArea,
        pileConfig: pileConfig ?? this.pileConfig,
        pileOutsideBorrow: pileOutsideBorrow ?? this.pileOutsideBorrow,
        pileType: pileType ?? this.pileType,
        powerAreaRfidArray: powerAreaRfidArray ?? this.powerAreaRfidArray,
        prepayRidingcardTip: prepayRidingcardTip ?? this.prepayRidingcardTip,
        rechargeThenPay: rechargeThenPay ?? this.rechargeThenPay,
        returnPowerOff: returnPowerOff ?? this.returnPowerOff,
        skip90parkCount: skip90parkCount ?? this.skip90parkCount,
        skipParkType: skipParkType ?? this.skipParkType,
        studyFreeTraffic: studyFreeTraffic ?? this.studyFreeTraffic,
        studyFreeTrafficNum: studyFreeTrafficNum ?? this.studyFreeTrafficNum,
        studyFreeTrafficType: studyFreeTrafficType ?? this.studyFreeTrafficType,
        tpReturnHelmet: tpReturnHelmet ?? this.tpReturnHelmet,
        userAuth: userAuth ?? this.userAuth,
        vehicleShareProfit: vehicleShareProfit ?? this.vehicleShareProfit,
        wearHelmetToAcc: wearHelmetToAcc ?? this.wearHelmetToAcc,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['area_monitor_lock_time'] = areaMonitorLockTime;
    map['balance_refund'] = balanceRefund;
    map['balance_refund_auto_pass'] = balanceRefundAutoPass;
    map['balance_refund_sub_give'] = balanceRefundSubGive;
    map['can_quick_open_car'] = canQuickOpenCar;
    map['consumer_service'] = consumerService;
    map['contact_mobile'] = contactMobile;
    map['dis_area_limit'] = disAreaLimit;
    map['dispatch_auto_lock_time'] = dispatchAutoLockTime;
    map['dispatch_not_allow_borrow'] = dispatchNotAllowBorrow;
    map['exclude_free_time'] = excludeFreeTime;
    map['first_use_balance'] = firstUseBalance;
    map['forbidden_zone_no_borrow'] = forbiddenZoneNoBorrow;
    map['force_pay_after_area'] = forcePayAfterArea;
    map['invoices_apply'] = invoicesApply;
    map['invoices_order_time'] = invoicesOrderTime;
    map['is_dispatch_auto_lock'] = isDispatchAutoLock;
    map['is_force_ai_station_return'] = isForceAiStationReturn;
    map['is_need_face_return'] = isNeedFaceReturn;
    map['is_open_invite_activity'] = isOpenInviteActivity;
    map['is_open_power_limit'] = isOpenPowerLimit;
    map['is_out_range_borrow'] = isOutRangeBorrow;
    map['is_outarea_helmet'] = isOutareaHelmet;
    map['is_rfid_power_off'] = isRfidPowerOff;
    map['is_scan_to_unlock_directly'] = isScanToUnlockDirectly;
    map['is_set_wireless_parking'] = isSetWirelessParking;
    map['is_show_map_bike_power'] = isShowMapBikePower;
    map['is_show_policy'] = isShowPolicy;
    map['is_skip_90park'] = isSkip90park;
    map['is_sync_mile_soc'] = isSyncMileSoc;
    map['is_unlock_page_show_map'] = isUnlockPageShowMap;
    map['learn_before_cycling'] = learnBeforeCycling;
    map['low_power_off_threshold'] = lowPowerOffThreshold;
    map['low_power_open_time_limit'] = lowPowerOpenTimeLimit;
    map['open_power_limit_time'] = openPowerLimitTime;
    map['open_time'] = openTime;
    map['open_type'] = openType;
    map['operate_area_rfid_array'] = operateAreaRfidArray;
    map['ord_appeal_image'] = ordAppealImage;
    map['ord_appeal_zero_auto_pass'] = ordAppealZeroAutoPass;
    map['ord_appeal_zero_auto_pass_time'] = ordAppealZeroAutoPassTime;
    map['out_range_borrow_time'] = outRangeBorrowTime;
    map['pay_after_area'] = payAfterArea;
    map['pile_config'] = pileConfig;
    map['pile_outside_borrow'] = pileOutsideBorrow;
    map['pile_type'] = pileType;
    map['power_area_rfid_array'] = powerAreaRfidArray;
    map['prepay_ridingcard_tip'] = prepayRidingcardTip;
    map['recharge_then_pay'] = rechargeThenPay;
    map['return_power_off'] = returnPowerOff;
    map['skip_90park_count'] = skip90parkCount;
    map['skip_park_type'] = skipParkType;
    map['study_free_traffic'] = studyFreeTraffic;
    map['study_free_traffic_num'] = studyFreeTrafficNum;
    map['study_free_traffic_type'] = studyFreeTrafficType;
    map['tp_return_helmet'] = tpReturnHelmet;
    map['user_auth'] = userAuth;
    map['vehicle_share_profit'] = vehicleShareProfit;
    map['wear_helmet_to_acc'] = wearHelmetToAcc;
    return map;
  }
}

class ElectricityConfig {
  ElectricityConfig({
    required this.openClassifyElc,
    required this.openPartPriceElc,
    this.classifyElc,
    this.elcCheck,
    this.elcQualifiedCheck,
    required this.changeLimit,
    required this.isThresholdChange,
  });

  ElectricityConfig.fromJson(dynamic json) {
    openClassifyElc = json['open_classify_elc']??0;
    openPartPriceElc = json['open_part_price_elc']??0;
    classifyElc = json['classify_elc']??0;
    elcCheck =
        json['elc_check'] != null ? ElcCheck.fromJson(json['elc_check']) : null;
    elcQualifiedCheck = json['elc_qualified_check'] != null
        ? ElcQualifiedCheck.fromJson(json['elc_qualified_check'])
        : null;
    changeLimit = json['change_limit']??0;
    isThresholdChange = json['is_threshold_change']??0;
  }

  late num openClassifyElc;
  late num openPartPriceElc;
  dynamic classifyElc;
  ElcCheck? elcCheck;
  ElcQualifiedCheck? elcQualifiedCheck;
  late num changeLimit;
  late num isThresholdChange;

  ElectricityConfig copyWith({
    num? openClassifyElc,
    num? openPartPriceElc,
    dynamic classifyElc,
    ElcCheck? elcCheck,
    ElcQualifiedCheck? elcQualifiedCheck,
    num? changeLimit,
    num? isThresholdChange,
  }) =>
      ElectricityConfig(
        openClassifyElc: openClassifyElc ?? this.openClassifyElc,
        openPartPriceElc: openPartPriceElc ?? this.openPartPriceElc,
        classifyElc: classifyElc ?? this.classifyElc,
        elcCheck: elcCheck ?? this.elcCheck,
        elcQualifiedCheck: elcQualifiedCheck ?? this.elcQualifiedCheck,
        changeLimit: changeLimit ?? this.changeLimit,
        isThresholdChange: isThresholdChange ?? this.isThresholdChange,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['open_classify_elc'] = openClassifyElc;
    map['open_part_price_elc'] = openPartPriceElc;
    map['classify_elc'] = classifyElc;
    if (elcCheck != null) {
      map['elc_check'] = elcCheck!.toJson();
    }
    if (elcQualifiedCheck != null) {
      map['elc_qualified_check'] = elcQualifiedCheck!.toJson();
    }
    map['change_limit'] = changeLimit;
    map['is_threshold_change'] = isThresholdChange;
    return map;
  }
}

class ElcQualifiedCheck {
  ElcQualifiedCheck({
    required this.minPower,
    required this.powerGreaterThanBefore,
    // required this.bonus,
    required this.elcCost,
  });

  ElcQualifiedCheck.fromJson(dynamic json) {
    minPower = json['min_power']??0;
    powerGreaterThanBefore = json['power_greater_than_before']??0;
    // bonus = [];
    // if (json['bonus'] != null) {
    //   json['bonus'].forEach((v) {
    //     bonus!.add(Dynamic.fromJson(v));
    //   });
    // }
    elcCost = json['elc_cost']??0;
  }

  late num minPower;
  late num powerGreaterThanBefore;

  // List<dynamic>? bonus;
  late num elcCost;

  ElcQualifiedCheck copyWith({
    num? minPower,
    num? powerGreaterThanBefore,
    // List<dynamic>? bonus,
    num? elcCost,
  }) =>
      ElcQualifiedCheck(
        minPower: minPower ?? this.minPower,
        powerGreaterThanBefore:
            powerGreaterThanBefore ?? this.powerGreaterThanBefore,
        // bonus: bonus ?? this.bonus,
        elcCost: elcCost ?? this.elcCost,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['min_power'] = minPower;
    map['power_greater_than_before'] = powerGreaterThanBefore;
    // if (bonus != null) {
    //   map['bonus'] = bonus!.map((v) => v.toJson()).toList();
    // }
    map['elc_cost'] = elcCost;
    return map;
  }
}

class ElcCheck {
  ElcCheck({
    required this.storageElcOpenCheck,
    required this.storageElcCloseCheck,
    required this.threshold,
  });

  ElcCheck.fromJson(dynamic json) {
    storageElcOpenCheck = json['storage_elc_open_check']??0;
    storageElcCloseCheck = json['storage_elc_close_check']??0;
    threshold = json['threshold']??0;
  }

  late num storageElcOpenCheck;
  late num storageElcCloseCheck;
  late num threshold;

  ElcCheck copyWith({
    num? storageElcOpenCheck,
    num? storageElcCloseCheck,
    num? threshold,
  }) =>
      ElcCheck(
        storageElcOpenCheck: storageElcOpenCheck ?? this.storageElcOpenCheck,
        storageElcCloseCheck: storageElcCloseCheck ?? this.storageElcCloseCheck,
        threshold: threshold ?? this.threshold,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['storage_elc_open_check'] = storageElcOpenCheck;
    map['storage_elc_close_check'] = storageElcCloseCheck;
    map['threshold'] = threshold;
    return map;
  }
}

class DispatchConfig {
  DispatchConfig({
    required this.timeLimit,
    required this.isMustUploadImg,
    this.qualified,
    // this.extraPoint,
    required this.basisAmount,
    required this.rewardAmount,
    required this.maxReward,
    required this.notOrderCannot,
    required this.noOrderSwitch,
    required this.noOrderDelta,
    required this.effects,
    required this.effects2,
  });

  DispatchConfig.fromJson(dynamic json) {
    timeLimit = json['time_limit'];
    isMustUploadImg = json['is_must_upload_img'];
    qualified = json['qualified'] != null
        ? Qualified.fromJson(json['qualified'])
        : null;
    // extraPoint = json['extra_point'] != null
    //     ? ExtraPoint.fromJson(json['extra_point'])
    //     : null;
    basisAmount = json['basis_amount'];
    rewardAmount = json['reward_amount'];
    maxReward = json['max_reward'];
    notOrderCannot = json['not_order_cannot'];
    noOrderSwitch = json['no_order_switch'];
    noOrderDelta = json['no_order_delta'];
    effects = json['effects'];
    effects2 = json['effects2'];
  }

  late num timeLimit;
  late num isMustUploadImg;
  Qualified? qualified;
  // ExtraPoint? extraPoint;
  late num basisAmount;
  late num rewardAmount;
  late num maxReward;
  late num notOrderCannot;
  late num noOrderSwitch;
  late num noOrderDelta;
  late num effects;
  late num effects2;

  DispatchConfig copyWith({
    num? timeLimit,
    num? isMustUploadImg,
    Qualified? qualified,
    // ExtraPoint? extraPoint,
    num? basisAmount,
    num? rewardAmount,
    num? maxReward,
    num? notOrderCannot,
    num? noOrderSwitch,
    num? noOrderDelta,
    num? effects,
    num? effects2,
  }) =>
      DispatchConfig(
        timeLimit: timeLimit ?? this.timeLimit,
        isMustUploadImg: isMustUploadImg ?? this.isMustUploadImg,
        qualified: qualified ?? this.qualified,
        // extraPoint: extraPoint ?? this.extraPoint,
        basisAmount: basisAmount ?? this.basisAmount,
        rewardAmount: rewardAmount ?? this.rewardAmount,
        maxReward: maxReward ?? this.maxReward,
        notOrderCannot: notOrderCannot ?? this.notOrderCannot,
        noOrderSwitch: noOrderSwitch ?? this.noOrderSwitch,
        noOrderDelta: noOrderDelta ?? this.noOrderDelta,
        effects: effects ?? this.effects,
        effects2: effects2 ?? this.effects2,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['time_limit'] = timeLimit;
    map['is_must_upload_img'] = isMustUploadImg;
    if (qualified != null) {
      map['qualified'] = qualified!.toJson();
    }
    // if (extraPoint != null) {
    //   map['extra_point'] = extraPoint!.toJson();
    // }
    map['basis_amount'] = basisAmount;
    map['reward_amount'] = rewardAmount;
    map['max_reward'] = maxReward;
    map['not_order_cannot'] = notOrderCannot;
    map['no_order_switch'] = noOrderSwitch;
    map['no_order_delta'] = noOrderDelta;
    map['effects'] = effects;
    map['effects2'] = effects2;
    return map;
  }
}

class ExtraPoint {
  ExtraPoint({
    this.fastOrderStats,
    // this.h24OrderStats,
    // this.h24ValidOrderStats,
    required this.detainBike,
    required this.storageBike,
    required this.outAreaBike,
  });

  ExtraPoint.fromJson(dynamic json) {
    fastOrderStats = json['fast_order_stats'] != null
        ? FastOrderStats.fromJson(json['fast_order_stats'])
        : null;
    // h24OrderStats = json['h24_order_stats'] != null
    //     ? H24ValidOrderStats.fromJson(json['h24_order_stats'])
    //     : null;
    // h24ValidOrderStats = json['h24_valid_order_stats'] != null
    //     ? H24ValidOrderStats.fromJson(json['h24_valid_order_stats'])
    //     : null;
    detainBike = json['detain_bike'];
    storageBike = json['storage_bike'];
    outAreaBike = json['out_area_bike'];
  }

  FastOrderStats? fastOrderStats;
  // H24ValidOrderStats? h24OrderStats;
  // H24ValidOrderStats? h24ValidOrderStats;
  late num detainBike;
  late num storageBike;
  late num outAreaBike;

  ExtraPoint copyWith({
    FastOrderStats? fastOrderStats,
    // H24ValidOrderStats? h24OrderStats,
    // H24ValidOrderStats? h24ValidOrderStats,
    num? detainBike,
    num? storageBike,
    num? outAreaBike,
  }) =>
      ExtraPoint(
        fastOrderStats: fastOrderStats ?? this.fastOrderStats,
        // h24OrderStats: h24OrderStats ?? this.h24OrderStats,
        // h24ValidOrderStats: h24ValidOrderStats ?? this.h24ValidOrderStats,
        detainBike: detainBike ?? this.detainBike,
        storageBike: storageBike ?? this.storageBike,
        outAreaBike: outAreaBike ?? this.outAreaBike,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (fastOrderStats != null) {
      map['fast_order_stats'] = fastOrderStats!.toJson();
    }
    // if (h24OrderStats != null) {
    //   map['h24_order_stats'] = h24OrderStats!.toJson();
    // }
    // if (h24ValidOrderStats != null) {
    //   map['h24_valid_order_stats'] = h24ValidOrderStats!.toJson();
    // }
    map['detain_bike'] = detainBike;
    map['storage_bike'] = storageBike;
    map['out_area_bike'] = outAreaBike;
    return map;
  }
}

class H24ValidOrderStats {
  H24ValidOrderStats({
    required this.numb,
    required this.score,
  });

  H24ValidOrderStats.fromJson(dynamic json) {
    numb = json['num'];
    score = json['score'];
  }

  late num numb;
  late num score;

  H24ValidOrderStats copyWith({
    num? numb,
    num? score,
  }) =>
      H24ValidOrderStats(
        numb: numb ?? this.numb,
        score: score ?? this.score,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['num'] = numb;
    map['score'] = score;
    return map;
  }
}

class FastOrderStats {
  FastOrderStats({
    required this.hour,
    required this.score,
  });

  FastOrderStats.fromJson(dynamic json) {
    hour = json['hour'];
    score = json['score'];
  }

  late num hour;
  late num score;

  FastOrderStats copyWith({
    num? hour,
    num? score,
  }) =>
      FastOrderStats(
        hour: hour ?? this.hour,
        score: score ?? this.score,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['hour'] = hour;
    map['score'] = score;
    return map;
  }
}

class Qualified {
  Qualified({
    required this.distinct,
    required this.minute,
    required this.level,
  });

  Qualified.fromJson(dynamic json) {
    distinct = json['distinct'];
    minute = json['minute'];
    level = json['level'];
  }

  late num distinct;
  late num minute;
  late num level;

  Qualified copyWith({
    num? distinct,
    num? minute,
    num? level,
  }) =>
      Qualified(
        distinct: distinct ?? this.distinct,
        minute: minute ?? this.minute,
        level: level ?? this.level,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['distinct'] = distinct;
    map['minute'] = minute;
    map['level'] = level;
    return map;
  }
}

class HelmetFreeInfo {
  HelmetFreeInfo({
    required this.openHelmetCheck,
    required this.unuseHelmetFee,
  });

  HelmetFreeInfo.fromJson(dynamic json) {
    openHelmetCheck = json['open_helmet_check'];
    unuseHelmetFee = json['unuse_helmet_fee'];
  }

  late num openHelmetCheck;
  late num unuseHelmetFee;

  HelmetFreeInfo copyWith({
    num? openHelmetCheck,
    num? unuseHelmetFee,
  }) =>
      HelmetFreeInfo(
        openHelmetCheck: openHelmetCheck ?? this.openHelmetCheck,
        unuseHelmetFee: unuseHelmetFee ?? this.unuseHelmetFee,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['open_helmet_check'] = openHelmetCheck;
    map['unuse_helmet_fee'] = unuseHelmetFee;
    return map;
  }
}

class OperationConfig {
  OperationConfig({
    required this.isShowRealNumbers,
    required this.displayNumbers,
    required this.displayDistance,
    required this.isCustomChange,
    required this.minChangeRange,
    required this.maxChangeRange,
    required this.changeField,
    required this.isAggregateMap,
    required this.isOpenFastDispatch,
    required this.isShowNumbers,
    required this.ridingCarShow,
    required this.noOrderAutoLock,
    required this.motDays,
    required this.isElcRiding,
    required this.isDispatchAutoLock,
    required this.dispatchAutoLockTime,
    required this.ridingOperateDevice,
    required this.dispatchResetsRiding,
    required this.dispatchResetsCheckTime,
    required this.showMaxNumbers,
    required this.changeRuleByBattery,
    required this.isOutBound,
    // this.electricityShow,
    required this.patrolMustImg,
    required this.isShowRiding,
  });

  OperationConfig.fromJson(dynamic json) {
    isShowRealNumbers = json['is_show_real_numbers'];
    displayNumbers = json['display_numbers'];
    displayDistance = json['display_distance'];
    isCustomChange = json['is_custom_change'];
    minChangeRange = json['min_change_range'];
    maxChangeRange = json['max_change_range'];
    changeField = json['change_field'].toString();
    isAggregateMap = json['is_aggregate_map'];
    isOpenFastDispatch = json['is_open_fast_dispatch'];
    isShowNumbers = json['is_show_numbers'];
    ridingCarShow = json['riding_car_show'];
    noOrderAutoLock = json['no_order_auto_lock'];
    motDays = json['mot_days'];
    isElcRiding = json['is_elc_riding'];
    isDispatchAutoLock = json['is_dispatch_auto_lock'];
    dispatchAutoLockTime = json['dispatch_auto_lock_time'];
    ridingOperateDevice = json['riding_operate_device'];
    dispatchResetsRiding = json['dispatch_resets_riding'];
    dispatchResetsCheckTime = json['dispatch_resets_check_time'];
    showMaxNumbers = json['show_max_numbers'];
    changeRuleByBattery = json['change_rule_by_battery'];
    isOutBound = json['is_out_bound'];
    // electricityShow = json['electricity_show'] != null
    //     ? ElectricityShow.fromJson(json['electricity_show'])
    //     : null;
    patrolMustImg = json['patrol_must_img'];
    isShowRiding = json['is_show_riding']??0;
  }

  late num isShowRealNumbers;
  late num displayNumbers;
  late num displayDistance;
  late num isCustomChange;
  late num minChangeRange;
  late num maxChangeRange;
  late String changeField;
  late num isAggregateMap;
  late num isOpenFastDispatch;
  late num isShowNumbers;
  late num ridingCarShow;
  late num noOrderAutoLock;
  late num motDays;
  late num isElcRiding;
  late num isDispatchAutoLock;
  late num dispatchAutoLockTime;
  late num ridingOperateDevice;
  late num dispatchResetsRiding;
  late num dispatchResetsCheckTime;
  late num showMaxNumbers;
  late num changeRuleByBattery;
  late num isOutBound;
  // ElectricityShow? electricityShow;
  late num patrolMustImg;
  late num isShowRiding;

  OperationConfig copyWith({
    num? isShowRealNumbers,
    num? displayNumbers,
    num? displayDistance,
    num? isCustomChange,
    num? minChangeRange,
    num? maxChangeRange,
    String? changeField,
    num? isAggregateMap,
    num? isOpenFastDispatch,
    num? isShowNumbers,
    num? ridingCarShow,
    num? noOrderAutoLock,
    num? motDays,
    num? isElcRiding,
    num? isDispatchAutoLock,
    num? dispatchAutoLockTime,
    num? ridingOperateDevice,
    num? dispatchResetsRiding,
    num? dispatchResetsCheckTime,
    num? showMaxNumbers,
    num? changeRuleByBattery,
    num? isOutBound,
    // ElectricityShow? electricityShow,
    num? patrolMustImg,
    num? isShowRiding,
  }) =>
      OperationConfig(
        isShowRealNumbers: isShowRealNumbers ?? this.isShowRealNumbers,
        displayNumbers: displayNumbers ?? this.displayNumbers,
        displayDistance: displayDistance ?? this.displayDistance,
        isCustomChange: isCustomChange ?? this.isCustomChange,
        minChangeRange: minChangeRange ?? this.minChangeRange,
        maxChangeRange: maxChangeRange ?? this.maxChangeRange,
        changeField: changeField ?? this.changeField,
        isAggregateMap: isAggregateMap ?? this.isAggregateMap,
        isOpenFastDispatch: isOpenFastDispatch ?? this.isOpenFastDispatch,
        isShowNumbers: isShowNumbers ?? this.isShowNumbers,
        ridingCarShow: ridingCarShow ?? this.ridingCarShow,
        noOrderAutoLock: noOrderAutoLock ?? this.noOrderAutoLock,
        motDays: motDays ?? this.motDays,
        isElcRiding: isElcRiding ?? this.isElcRiding,
        isDispatchAutoLock: isDispatchAutoLock ?? this.isDispatchAutoLock,
        dispatchAutoLockTime: dispatchAutoLockTime ?? this.dispatchAutoLockTime,
        ridingOperateDevice: ridingOperateDevice ?? this.ridingOperateDevice,
        dispatchResetsRiding: dispatchResetsRiding ?? this.dispatchResetsRiding,
        dispatchResetsCheckTime:
            dispatchResetsCheckTime ?? this.dispatchResetsCheckTime,
        showMaxNumbers: showMaxNumbers ?? this.showMaxNumbers,
        changeRuleByBattery: changeRuleByBattery ?? this.changeRuleByBattery,
        isOutBound: isOutBound ?? this.isOutBound,
        // electricityShow: electricityShow ?? this.electricityShow,
        patrolMustImg: patrolMustImg ?? this.patrolMustImg,
        isShowRiding: isShowRiding ?? this.isShowRiding,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['is_show_real_numbers'] = isShowRealNumbers;
    map['display_numbers'] = displayNumbers;
    map['display_distance'] = displayDistance;
    map['is_custom_change'] = isCustomChange;
    map['min_change_range'] = minChangeRange;
    map['max_change_range'] = maxChangeRange;
    map['change_field'] = changeField;
    map['is_aggregate_map'] = isAggregateMap;
    map['is_open_fast_dispatch'] = isOpenFastDispatch;
    map['is_show_numbers'] = isShowNumbers;
    map['riding_car_show'] = ridingCarShow;
    map['no_order_auto_lock'] = noOrderAutoLock;
    map['mot_days'] = motDays;
    map['is_elc_riding'] = isElcRiding;
    map['is_dispatch_auto_lock'] = isDispatchAutoLock;
    map['dispatch_auto_lock_time'] = dispatchAutoLockTime;
    map['riding_operate_device'] = ridingOperateDevice;
    map['dispatch_resets_riding'] = dispatchResetsRiding;
    map['dispatch_resets_check_time'] = dispatchResetsCheckTime;
    map['show_max_numbers'] = showMaxNumbers;
    map['change_rule_by_battery'] = changeRuleByBattery;
    map['is_out_bound'] = isOutBound;
    // if (electricityShow != null) {
    //   map['electricity_show'] = electricityShow!.toJson();
    // }
    map['patrol_must_img'] = patrolMustImg;
    map['is_show_riding'] = isShowRiding;
    return map;
  }
}

class ElectricityShow {
  ElectricityShow({
    required this.lMin,
    required this.lMax,
    required this.mMin,
    required this.mMax,
    required this.hMin,
    required this.hMax,
  });

  ElectricityShow.fromJson(dynamic json) {
    lMin = json['l_min'];
    lMax = json['l_max'];
    mMin = json['m_min'];
    mMax = json['m_max'];
    hMin = json['h_min'];
    hMax = json['h_max'];
  }

  late num lMin;
  late num lMax;
  late num mMin;
  late num mMax;
  late num hMin;
  late num hMax;

  ElectricityShow copyWith({
    num? lMin,
    num? lMax,
    num? mMin,
    num? mMax,
    num? hMin,
    num? hMax,
  }) =>
      ElectricityShow(
        lMin: lMin ?? this.lMin,
        lMax: lMax ?? this.lMax,
        mMin: mMin ?? this.mMin,
        mMax: mMax ?? this.mMax,
        hMin: hMin ?? this.hMin,
        hMax: hMax ?? this.hMax,
      );

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['l_min'] = lMin;
    map['l_max'] = lMax;
    map['m_min'] = mMin;
    map['m_max'] = mMax;
    map['h_min'] = hMin;
    map['h_max'] = hMax;
    return map;
  }
}
